<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="//at.alicdn.com/t/font_2580075_ior08p3an3q.css">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
    }
    a {
      display: inline-block;
      text-decoration: none;
    }
    .searchBox {
      display: flex;
      justify-content: center;
      align-items: center;
      line-height: 32px;
      
    }
    .searchBox input {
      box-sizing: border-box;
      width: 0;
      height: 32px;
      padding-left: 20px;
      border-radius: 100px 0 0 100px;
      outline: none;
      border: none;
      background-color: #eee;
      max-width: 160px;
      font-size: 12px;
      transition: all .4s ease;
    }
    .searchBox input::-webkit-input-placeholder {
      color: #000;
    }
    .searchBox a{
      width:36px;
      height: 32px;
      text-align: center;
      background: tomato;
      border-left: 1px solid #000;
      border-radius: 0 100px 100px 0; 
      transition: all .4;
    }
    .searchBox a i {
      display:inline-block;
      transform: translateX(-2px);
      color: #fff;
      transition: all .4;
    }

    .searchBox:hover .ipt{
      width: 160px;
    }
    .searchBox a:hover {
      background-color: red;
    }
    .searchBox a:hover i {
      color: yellow;
    }
  </style>
</head>
<body>
  <div class="searchBox">
    <input class="ipt" type="text" placeholder="输入关键词进行搜索~">
    <a href="#"><i class="iconfont icon-sousuo"></i></a>
  </div>
</body>
</html>